<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>Swiper demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <!-- Link Swiper's CSS -->
    <!-- Demo styles -->
    <link rel="stylesheet" href="swiper.min.css">
    <script src="jquery.min.js"></script>
    <style>
    html,


    body {
        background: #eee;
        font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
        font-size: 14px;
        color: #000;
        margin: 0;
        padding: 0;
    }


    .swiper-slide {
        text-align: center;
        font-size: 18px;
        height: 250px;
        background: #fff;

        /* Center slide text vertically */
        display: -webkit-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
    }
    </style>
</head>
<script src="swiper.min.js"></script>

<body>
    <div class="swiper-container">
        <div class="swiper-wrapper price">
            <div class="swiper-slide" name="pro1">1 1</div>
            <div class="swiper-slide" name="pro2">1 2</div>
            <div class="swiper-slide" name="pro3">1 3</div>
            <div class="swiper-slide" name="pro4">1 4</div>
            <div class="swiper-slide" name="pro5">1 5</div>
            <div class="swiper-slide" name="pro6">1 6</div>
            <div class="swiper-slide" name="pro7">1 7</div>
            <div class="swiper-slide" name="pro8">1 8</div>
            <div class="swiper-slide" name="pro9">1 9</div>
            <div class="swiper-slide" name="pro10">1 10</div>
        </div>
        <div class="swiper-pagination"></div>
    </div>
    <!-- Swiper -->
    <div id="div1" style="margin-top:0;">
        







    <script>
    var mySwiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true
    });
    // Add one more handler for this event
    mySwiper.on('onSlideChangeEnd', function(swiper) {

        var para = $(".price").children().eq(swiper.activeIndex).attr("name");
       // alert(para); //para 要与服务交互的数据
        $.ajax({
            url: "demo.php",
            data: { product:para},
            success: function(result) {
                $("#div1").html(result);
            }
        });

    });
    </script>
</body>

</html>